let mystr: string = "I'm a good student!";
console.log(mystr);
mystr = 666 + '666';
const myconst: number = 6;
console.log(myconst);
let myboolean: boolean = true;
console.log(myboolean = false);
let myarray: Array<number> = [1, 2, 3, 4];
let myarray2: number[] = [2, 3, 4, 5];
myarray = [2, 3, 4,]; myarray2 = [3, 4, 5]
console.log(myarray, myarray2);
let myundefined1: undefined = undefined;
let mynull1: null = null;
declare function product(hi: object | null): void;
product({ ha: 6 });
product(null);
product({ a: false });
const aaa1: object = {
	name: 'qq',
	age: 18,
	height: 1.6,
}
function qq01_add(x: number, y: number): number {
	return x + y;
}
qq01_add(1, 2);
function qq01_splicing(x: string, y?: string | number, z?: number): string {
	return "${x}${y}" + z;
}
qq01_splicing("123")
qq01_splicing("老师", "好")
function qq01_name(x: string, y: string, z?: string): string {
	return x + y + z;
}
function buildName(firstName: string, lastName = 'Smith') {
	return firstName + "" + lastName;
}
buildName('Jack', 'Li')
function buildName1(lastName = 'Smith', firstName: string, ) {
	return firstName + "" + lastName;
}
buildName1(undefined, 'Li')
function buildName2(firstName: string, ...restofName: string[]): string {
	return firstName + " " + restofName.join(' ');
}
function qq011_add(x: string | number, y: string | number): string | number {
	if (typeof x === 'number' && typeof y === 'number') {
		return x + y;
	} else {
		return x.toString() + y.toString();
	}
};
qq011_add('1', 1)